package observerpattern.example1;

/**
 * 利用java自带观察者模式实现
 *
 * @author hongchen
 *         Created 2017-03-05-13:17
 */
public class Client {

    public static void main(String[] args) {

        ConcreteGongzonghaoSubject gzh = new ConcreteGongzonghaoSubject();

        ConcreteWeixinUserObserver user1 = new ConcreteWeixinUserObserver();
        ConcreteWeixinUserObserver user2 = new ConcreteWeixinUserObserver();

        user1.setUserObserverInfo("jack Ma");
        user2.setUserObserverInfo("mahuateng");

        gzh.addObserver(user1);
        gzh.addObserver(user2);

        gzh.setContend("this is time for you!");

    }

}
